import { myrequest } from '@/utils/request';

// 获取月卡列表接口
export const getCardListReqeust = (obj: any) => {
  return myrequest('/parking/card/list', 'get', obj);
};
// 获取区域列表接口
export const getAreaListReqeust = (obj: any) => {
  return myrequest('/parking/area/list', 'get', obj);
};
// 获取停车缴费列表接口
export const getPaymentListReqeust = (obj: any) => {
  return myrequest('/parking/payment/list', 'get', obj);
};
// 查看计费规则列表
export const getRuleListReqeust = (obj: any) => {
  return myrequest('/parking/rule/list', 'get', obj);
};

// 添加月卡
export const addParkingCardReqeust = (obj: any) => {
  return myrequest('/parking/card', 'post', obj);
};
// 删除月卡
export const deleteParkingCardReqeust = (ids: string) => {
  return myrequest(`/parking/card/${ids}`, 'delete');
};
// 获取编辑页月卡详情
export const getCardDetailReqeust = (id: any) => {
  return myrequest(`/parking/card/detail/${id}`, 'get');
};
// 编辑详情
export const editCardReqeust = (obj: any) => {
  return myrequest('/parking/card/edit', 'put', obj);
};

// 月卡续费
export const rechargeCardReqeust = (obj: any) => {
  return myrequest('/parking/card/recharge', 'POST', obj);
};

// 查看月卡详情
export const getCardDetailListReqeust = (id: any) => {
  return myrequest(`/parking/card/${id}`, 'GET');
};

// 获取关联区域下拉列表
export const getAreaDropListReqeust = () => {
  return myrequest('/parking/area/dropList', 'GET');
};
// 获取查看计费规则列表 --- 区域的页面 需要区域 规则的请求里面找
// export const getRuleListReqeust = (obj: any) => {
//   return myrequest('/parking/rule/list', 'GET', obj);
// };

// 添加区域
export const addAreaReqeust = (obj: any) => {
  return myrequest('/parking/area', 'POST', obj);
};

// 删除区域
export const deleteAreaReqeust = (id: any) => {
  return myrequest(`/parking/area/${id}`, 'DELETE');
};

// 编辑区域
export const editAreaReqeust = (obj: any) => {
  return myrequest('/parking/area', 'PUT', obj);
};

// 添加计费规则
export const addRuleReqeust = (obj: any) => {
  return myrequest('/parking/rule', 'POST', obj);
};
